//==============================================================================================================================================================
// Author(s): Roman Khmelichek, Wei Jiang
//
//==============================================================================================================================================================

#ifndef INDEX_CAT_H_
#define INDEX_CAT_H_

#include <fstream>

#include <iostream>
#include <map>
#include <string>

#include "document_collection.h"

using namespace std;

/**************************************************************************************************************************************************************
 * IndexCat
 *
 **************************************************************************************************************************************************************/
class IndexFiles;
class Index;
class CollectionIndexer;

class IndexCat {
public:
  IndexCat(const IndexFiles& index_files);
  ~IndexCat();

  //Lots of overridiing for different purposes.
  void Cat(string docID, map<string, string> &docLookUpDict, map<string, string> &fileLookUpDict, string &previousFilePath);
  void Cat(const char* term, int term_len);
  void Cat(const char* term, int term_len, string flagString, ofstream &outputFileHandler, string queryNumber, string docID);
  void Cat(const char* term, int term_len, string flagString, ofstream &outputFileHandler, string queryNumber, string docID, map<string, string> &docLookUpDict, map<string, string> &fileLookUpDict, int &numberOfDocIDNotFound);
  void Cat(string flagString, ofstream &outputFileHandler, vector<string> &queryID_Term_docIDList, string docID, map<string, string> &docLookUpDict, map<string, string> &fileLookUpDict, string &previousFilePath, int &numberOfDocNotFound);

  CollectionIndexer& GetCollectionIndexer();

private:
  Index* index_;

  // Some index properties.
  bool includes_contexts_;
  bool includes_positions_;
};

#endif /* INDEX_CAT_H_ */
